package com.bdqn.mapper;

import com.bdqn.pojo.SysUser;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface SysUserMapper {
    /**
     * 根据账号和密码进行查询实现登录的功能
     *
     * @param account
     * @param password
     * @return
     */
    SysUser queryByAccountAndPwd(@Param("account")String account, @Param("password")String password);

    /**
     * 根据角色名称、角色id查询总数据量
     * @param realName
     * @param roleId
     * @return
     */
    int getUserCount(@Param("realName") String realName,@Param("roleId") int roleId);

    /**
     * 分页查询
     * @param realName
     * @param roleId
     * @return
     */
    List<SysUser> getUserList(@Param("realName") String realName, @Param("roleId") int roleId,
                              @Param("pageIndex") int pageIndex, @Param("pageSize") int pageSize);

    int getUserById(SysUser sysUser);

    int add(SysUser sysUser);

    /**
     * 通过Account获取用户
     * @param account
     * @return
     * @throws Exception
     */
    SysUser selectByAccount(String account)throws Exception;

}
